/*
 *
 *   公共方法
 *   version 1.1
 *
 */
/**
 * 获取路由URL地址
 */
function ApiRoute(name) {
    var api_url = Config.api_url;
    var route = ROUTES[name];
    return api_url + route;
}
function replace(target, el) {
    var parent = target.parentNode;
    if (parent) {
        parent.replaceChild(el, target);
    }
}
//得到地址传来的参数
function getUrlParam(val) {
    var reg = new RegExp("(^|&)" + val + "=([^&]*)(&|$)");
    var r = decodeURI(window.location.search).substr(1).match(reg);
    if (r != null)
        return unescape(r[2]);
    return null;
}
